#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int m;
int mian()
{
    int a[9],ii=0,i,a1,a2,a3,a4,b1,b2,b3,b4,falg;
    for(i=1;i<=m;i++)
    {
        printf("Please enter[%d]number:",i);
        scanf("%d",&a[i]);
        scanf("%d",&a[i]);
        ii+=a[i];
    }
    printf("*************************\n");
    exit(0);
};

for(falg=0,a1=1;a1<=8;a1++)
for(a2=1; a2<=8; a2++)
if(a2!=a1)
for(a3=1;a3<=8;a3++)
if(a3!=a2&&a3!=a1)
for(a4=1;a4<=8;a4++)
if(a4!a3&&a4!=a2&&a4!=a1)
for(b1=1;b1<=8;b1++)
if(b1!=a4&&b1!=a3 && b1!=a2&&b1!=a1)
for(b2=1;b2<=8;b2++)
if(b2!=b1&&b2!=a4 && b2!=a3&&b2!=a2!=a2&&b2!=a1)
for(b3=1;b3<=8;b3++)
if(b3!=b2 &&b3!=b1&&b3!=a4&&b3!=a3
    &&b3!=a2&&b3!=a1)
for(b4=1;b4<=8;b4++)
if(b4!=b2&&b4!=b1&&b4!=b3&&b4!=a4&&
    b4!=a3&&b4!=a2&&b4!=a1)
if(a[b1]+a[b2]+a[b3]+[b4]==ii/2)
    &&a[a1]+a[a2]+a[b1]+a[b2]==ii/2
    &&a[a1]+a[a4]+a[b1]+a[b4]==ii/2
    {
        flag=1;goto out;
    }
out:
if(flag)
{
    printf("They can be constructed required cube as follow:\n");
    printf("            /%2d___________/%2d\n",a[a4],a[a3]);
    printf("         %2d/_____________%2d/|n",a[al],a[a2]);
    printf("                |   |       |    |\n");
    printf("                |   |       |    |\n");
    printf("           |%2d |   %2d       |    |%2d\n",a[b4],a[b3]);
    printf("        /_________________-/\n");
    printf("        %2d/______________%2d\n",a[b1],a[b2]);
   
    else printf("Sorry they can't be constructed required cube !\n" );
}